package com.online.college.rest.business;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Service;

import com.online.college.core.consts.CourseEnum;
import com.online.college.core.course.domain.Course;
import com.online.college.core.course.service.ICourseService;

@Service
public class CourseBusinessImpl implements ICourseBusiness {

	@Autowired
	private ICourseService courseService;

	@Override
	public Map<String, List<Course>> getCourse() {
		Map<String, List<Course>> returnMap = new HashMap<String, List<Course>>();
		Course bean = new Course();
		bean.setFree(CourseEnum.FREE.value());
		returnMap.put("freeCourses", courseService.getFiveCourse(bean));
		bean.setFree(CourseEnum.FREE_NOT.value());
		returnMap.put("actionCourses", courseService.getFiveCourse(bean));
		return returnMap;
	}

}
